import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;

import javax.swing.JComponent;

public abstract class TownLocation extends JComponent {
	protected String name;
	private Image image;
	private Point p;
	
	/**
	 * 
	 * @param n name of tile
	 * @param p location of tile
	 * @param image the image of tile
	 */
	public TownLocation(String n, Point p, Image image) {
		name = n;
		this.p = p;
		this.image = image;
	}
	
	/**
	 * 
	 * @param g graphic of tile
	 * @param tw tile width
	 * @param th tile heigth
	 */
	public void draw(Graphics g, int tw, int th){
		g.drawImage(image, p.y * 100, p.x * 100, tw, th, null);

	}
	public int getX() {
		return (int)p.getX();
	}
	
	public int getY() {
		return (int)p.getY();
	}
}
